﻿

namespace TouchPoint.Core
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    using Windows.UI;

    using Microsoft.Graphics.Canvas;
    using Microsoft.Graphics.Canvas.Brushes;
    using Microsoft.Graphics.Canvas.Effects;
    using Microsoft.Graphics.Canvas.Geometry;
    using Microsoft.Graphics.Canvas.Printing;
    using Microsoft.Graphics.Canvas.Text;
    using Microsoft.Graphics.Canvas.UI;
    using Microsoft.Graphics.Canvas.UI.Xaml;

    public sealed class DrawingContext
    {

        //---------------------------------------------------------------------------------------------------
        //  该类封装所有的资源调度
        //---------------------------------------------------------------------------------------------------

        ICanvasResourceCreator  _sender;
        CanvasTextFormat        _format;

        public DrawingContext(CanvasControl canvas)
        {
            _sender = canvas;
        }

        public CanvasTextLayout CreateLayout(string text)
        {
            return new CanvasTextLayout(_sender, text, _format, 1920, 1920);
        }

        public CanvasTextLayout CreateTextLayout(string text,float width,float height)
        {
            return new CanvasTextLayout(_sender, text, _format, width, height);
        }

        public CanvasTextLayout CreateTextLayout(string text,CanvasTextFormat format,float width,float height)
        {
            return new CanvasTextLayout(_sender, text, format, width, height);
        }
    }
}
